package com.share.user.api;


import com.share.common.core.constant.SecurityConstants;
import com.share.common.core.constant.ServiceNameConstants;
import com.share.common.core.domain.R;
import com.share.user.api.factory.RemoteUserInfoFallbackFactory;
import com.share.user.api.model.LoginUserInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

/**
 * @author zt181
 * @date 2025/7/1
 */
@FeignClient(contextId = "remoteUserInfoService", value = ServiceNameConstants.USER_SERVICE, fallbackFactory = RemoteUserInfoFallbackFactory.class)
public interface RemoteUserInfoService {


    @GetMapping("/user/info/{code}")
    R<LoginUserInfo> getUserInfoByCode(@PathVariable("code") String code, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @GetMapping("/user/info/{userId}")
    R<LoginUserInfo> getUserInfo(@PathVariable Long userId, String inner);
}
